1
general::
An extremely clever or adroit maneuver, as in It looked as though the party was going to achieve a hat trick in this election. The term originated in cricket, where it refers to three wickets taken by a bowler in three consecutive balls, traditionally rewarded with the presentation of a hat. It later was transferred to ice hockey, soccer, and baseball, where it denotes three consecutive successes (goals, hits), and then to more general use.
American Heritage Idioms